下标越界: '[number: 0]'

来源:百度知道 编辑:UC知道 时间:2024/05/11 01:55:27
Microsoft VBScript 运行时错误 错误 '800a0009'

下标越界: '[number: 0]'

/my/Guestbook.asp,行 67

Do while not RsG.eof

Set GetP=Conn.execute("Select ZONEPHOTO From TUSERZONE Where UserID='"&RsG("doUserID")&"'")
If Not getp.eof Then
ZonePhoto=GetP("ZONEPHOTO")
FileNameArr=Split(ZonePhoto,".")
67行:PhotoPathMedium=FileNameArr(0)&"."&FileNameArr(1)
else
PhotoPathMedium="/biz/images/NoPics6.gif"
End if
Set GetP=Nothing

If Not getp.eof Then
ZonePhoto=GetP("ZONEPHOTO")
If ZonePhoto<>"" And InStr(ZonePhoto,".")>0 Then
FileNameArr=Split(ZonePhoto,".")
PhotoPathMedium=FileNameArr(0)&"."&FileNameArr(1)
Else
PhotoPathMedium="/biz/images/NoPics6.gif"
End If

else
PhotoPathMedium="/biz/images/NoPics6.gif"
End if
Set GetP=Nothing

66,67行代码的用意,基本上65,66,67可以改成PhotoPathMedium=GetP("ZONEPHOTO")
66行把文件名分开,67行又合起来了,如果文件名有多个“.”的话显示的图片文件名就会不正确(第二个"."后的内容会不显示),如果没有“.”的话就会报你所说的错误,所以还是不要吧